use rbatis::rbdc::DateTime;
use serde::{Deserialize, Serialize};

/// UserCreateRequest 创建用户
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct UserCreateRequest {
    /** 用户名称 */
    pub username: String,
    /** 账号 */
    pub password: String,
    /** 用户类型 */
    #[serde(rename(serialize = "type"))]
    pub user_type: i8,
    /** 业务线权限 */
    pub permission_biz: Option<String>,
}

/// UserPageRequest 用户分页查询
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct UserPageRequest {
    page: u64,
    limit: u64,
    name: Option<String>,
    user_type: Option<u8>,
}

/// UserPageResponse 用户分页响应
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct UserPageResponse {
    pub id: u64,
    /** 用户名称 */
    pub username: String,
    /** 账号 */
    pub password: String,
    /** 用户类型 */
    #[serde(rename(serialize = "type"))]
    pub user_type: i8,
    /** 业务线权限 */
    pub permission_biz: Option<String>,
    #[serde(with = "utils::time")]
    pub create_time: DateTime,
    pub update_time: Option<DateTime>,
}

/// UserInfoResponse 用户详情实体类
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct UserInfoResponse {

}
